/* 
 * File:   FontDesc.h
 * Author: artem
 *
 * Created on November 20, 2011, 3:08 PM
 */

#ifndef FONTDESC_H
#define FONTDESC_H

#include "Common.h"

namespace Resource
{
	struct Glyph
	{
		uint16_t x;
		uint16_t y;
		uint16_t w;
		uint16_t h;
		uint32_t ch;
		int16_t  xadv;
		int16_t  yadv;
		int16_t  xoff;
		int16_t  yoff;
		//int8_t   kern[256];
	};
	
	struct FontHead
	{
		Glyph    glyphs[256];
		uint16_t width;
		uint16_t height;
	};
	
	struct FontDesc : FontHead
	{
		uint16_t *bitmap;
		
		FontDesc(): bitmap(NULL) {}
		FontDesc(uint16_t width, uint16_t height)
		{
			bitmap = new uint16_t[width * height];
		}
		~FontDesc() { delete[] bitmap; }
	};
	
	FontDesc* loadFontDesc(const char *name);
}

#endif /* FONTDESC_H */
